﻿<?php TPL::output('global/header_meta.tpl.htm'); ?>

<body id="default_bd">
<div class="wrapper">
	<!--头部_s-->
	<div class="i_header">
		<div class="i_bd i_prl x_brs">
			<h1 class="logo i_cl_04"><a href="<?php echo get_setting('base_url'); ?>"><img class="img" src="<?php echo G_STATIC_URL; ?>/css/<?php echo $this->template_name; ?>/img/logo_103x25.png" alt="<?php echo get_setting('site_name'); ?>" /></a><?php echo get_setting('site_name'); ?></h1>
			<div class="i_message i_pas">
				<?php if ($this->user_id) { ?>
				<p>
					<a href="people/<?php echo $this->user_info['url_token']; ?>" class="user_head i_alpHover"><?php echo $this->user_info['user_name']; ?><img src="<?php echo get_avatar_url($this->user_info['uid'], 'mid'); ?>" title="<?php echo $this->user_info['user_name']; ?>" alt="<?php echo $this->user_info['user_name']; ?>"/></a>
					<span class="lx_set i_prl"><em class="i_arrows"></em><a href="account/setting/profile/" title="设置" class="set">设置</a><?php if($this->user_info['permission']['is_administortar'] ) { ?><a href="<?php echo get_setting('base_url') . G_INDEX_SCRIPT; ?>admin/" title="管理" class="manage" target="_blank">管理</a><?php } ?><a href="account/logout/" class="exit">退出</a></span>
				</p>
				
				<a href="inbox/" class="private_letter">私信<em class="i_message_tooltip_s i_hide inbox_num">0</em></a><a href="notifications/" class="not_message" id="not_message">通知<em class="i_message_tooltip_s i_hide" id="notifications_num" data-value="<?php echo $this->user_info['notification_unread']; ?>"><?php echo $this->user_info['notification_unread']; ?></em></a>
				<?php } else { ?>
					<a id ="user_login" style="color:white;" href="account/login/">登录</a> <a id = "user_reg" href="account/register/">注册</a>
				<?php } ?>
			</div>
		</div>
		
		<div class="i_prl i_bg">
			<ul class="i_menu">
				<?php if ($this->user_id || $this->user_info['permission']['search_avail']) { ?>
				<li class="i_right">
					<div class="i_search i_prl">
					<form action="search/" id="global_search_form" method="post">
						<input class="i_txt" autocomplete="off" name="q" value="搜索站点、标签或人" onSubmit="return false;" id="i_search" data-category_enable="<?php echo (get_setting('category_enable') == 'Y') ? 1 : 0; ?>" title="搜索站点、标签或人..."/>
						<a href="javascript:;" id="global_search_btns" onClick="$('#global_search_form').submit();" class="i_result i_pas" title="点击搜索 »">搜索</a>
					</form>
					</div>
				</li>
				<?php } ?>
				
				<?php if ($this->user_id) { ?><li class="i_dexBg"><a href="<?php echo get_setting('base_url'); ?><?php if (get_setting('url_rewrite_enable') != 'Y') { ?>/<?php echo rtrim(G_INDEX_SCRIPT, '/'); ?><?php } ?>" class="i_index<?php if (!$_GET['app'] OR ($_GET['app'] == 'home' AND $_GET['act'] != 'explore')) { ?> i_curr<?php } ?>"><em class="i i_small"></em>首页</a></li><?php } ?>
				<li class="<?php if (!$this->user_id) { ?>i_dexBg<?php } ?>"><a href="home/explore/" class="i_index<?php if ($_GET['app'] == 'question' OR $_GET['act'] == 'explore') { ?> i_curr<?php } ?>"><em class="q i_small"></em>站点</a></li>
				<li><a href="topic/" class="i_index<?php if ($_GET['app'] == 'topic') { ?> i_curr<?php } ?>"><em class="t i_small"></em>标签</a></li>
				<li><a href="people/list/" class="i_index<?php if ($_GET['app'] == 'people') { ?> i_curr<?php } ?>"><em class="u i_small"></em>用户</a></li>
				<li><a href="special/main/" class="i_index<?php if ($_GET['app'] == 'special') { ?> i_curr<?php } ?>"><em class="u i_small"></em>用户</a></li>
			</ul>
			
			<a href="publish/<?php if ($_GET['category']) { ?>category_id-<?php echo intval($_GET['category']); ?>__<?php } ?><?php if ($this->topic_info) { ?>topic_title-<?php echo urlencode($this->topic_info['topic_title']); ?>__<?php } ?>" class="start_question i_pas<?php if ($_GET['app'] == 'publish') { ?> cur<?php } ?>"<?php if (get_setting('quick_publish') == 'Y' && $this->user_id) { ?> onClick="$.startQs({flgs:0, category_enable:<?php echo (get_setting('category_enable') == 'Y') ? 1 : 0; ?>, category_id:'<?php echo intval($_GET['category']); ?>', topic_title:'<?php echo $this->topic_info['topic_title']; ?>'}); return false;"<?php } ?> title="发起你的站点，寻找最佳答案 »">发起</a>
		</div>
	</div>
	<!--头部_e-->